//
//  LCNavigationController.m
//  HQBProject
//
//  Created by taolei-mac on 2017/4/18.
//  Copyright © 2017年 com.zhejiangchain.ios. All rights reserved.
//

#import "LCNavigationController.h"

@interface LCNavigationController ()

@end

@implementation LCNavigationController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self setupNavigationBarTheme];
    
}

- (void)setupNavigationBarTheme
{
    UINavigationBar *navBar = [UINavigationBar appearance];
    navBar.translucent = YES;
    [navBar setBackgroundImage:[UIImage createImageWithColor:LCColor(159, 159, 159)] forBarMetrics:UIBarMetricsDefault];
    
    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
    textAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:20];
    textAttrs[NSForegroundColorAttributeName] = [UIColor whiteColor];
    NSShadow *shadow = [[NSShadow alloc] init];
    shadow.shadowOffset = CGSizeZero;
    textAttrs[NSShadowAttributeName] = shadow;
    [navBar setTitleTextAttributes:textAttrs];
}


/**
 *  拦截导航控制器的push操作
 */
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if(self.viewControllers.count > 0){
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
    [super pushViewController:viewController animated:animated];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
   
}



@end
